import React, { PureComponent } from 'react'

//setState必须传一个新地址，否则(只是数据内部发生改变)不会进行state更新
export default class Demo extends PureComponent {
    state = {
        username: "Tom",
        age: 18
    }
    render() {
        return (
            <div>
                {this.state.username}
                <Child />
            </div>
        )
    }
}

class Child extends PureComponent {
    render() {
        return (
            <div>
                child
            </div>
        )
    }
}